-- GENERATED SPELL FOR [Sundered Rumbler] --


function spell0_18881(pUnit, Event) --@Create Elemental Power,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(34525,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18881', 1, 1)
end

function spell1_18881(pUnit, Event) --@Summon Sundered Shard,Self--
pUnit:FullCastSpellOnTarget(35310,pUnit)
pUnit:RegisterEvent('Sorts_18881', 527, 1)
end

function Sorts_18881(pUnit, Event)
local choix_sorts_18881 = math.random(0, 1)
if choix_sorts_18881 == 0 then
pUnit:RegisterEvent('spell0_18881', 1, 1)
end
if choix_sorts_18881 == 1 then
pUnit:RegisterEvent('spell1_18881', 1, 1)
end
end

function mob18881_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18881', math.random(1500, 3000), 1)
end

function mob18881_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18881_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18881_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18881, 1, 'mob18881_Action')
RegisterUnitEvent(18881, 2, 'mob18881_Leave')
RegisterUnitEvent(18881, 3, 'mob18881_Kill')
RegisterUnitEvent(18881, 4, 'mob18881_Die')
